package com.ruoyi.qiushi.service.followup.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.qiushi.domain.followup.QiushiFormItem;
import com.ruoyi.qiushi.mapper.followup.QiushiFormItemMapper;
import com.ruoyi.qiushi.service.followup.IQiushiFormItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 问答单项Service业务层处理
 *
 * @author ruoyi
 * @date 2023-12-19
 */
@Service
public class QiushiFormItemServiceImpl implements IQiushiFormItemService {
    @Autowired
    private QiushiFormItemMapper qiushiFormItemMapper;

    /**
     * 查询问答单项
     *
     * @param id 问答单项主键
     * @return 问答单项
     */
    @Override
    public QiushiFormItem selectQiushiFormItemById(Long id) {
        return qiushiFormItemMapper.selectQiushiFormItemById(id);
    }

    /**
     * 查询问答单项列表
     *
     * @param qiushiFormItem 问答单项
     * @return 问答单项
     */
    @Override
    public List<QiushiFormItem> selectQiushiFormItemList(QiushiFormItem qiushiFormItem) {
        return qiushiFormItemMapper.selectQiushiFormItemList(qiushiFormItem);
    }

    /**
     * 新增问答单项
     *
     * @param qiushiFormItem 问答单项
     * @return 结果
     */
    @Override
    public int insertQiushiFormItem(QiushiFormItem qiushiFormItem) {
        qiushiFormItem.setCreateTime(DateUtils.getNowDate());
        return qiushiFormItemMapper.insertQiushiFormItem(qiushiFormItem);
    }

    /**
     * 修改问答单项
     *
     * @param qiushiFormItem 问答单项
     * @return 结果
     */
    @Override
    public int updateQiushiFormItem(QiushiFormItem qiushiFormItem) {
        qiushiFormItem.setUpdateTime(DateUtils.getNowDate());
        return qiushiFormItemMapper.updateQiushiFormItem(qiushiFormItem);
    }

    /**
     * 删除问答单项信息
     *
     * @param id 问答单项主键
     * @return 结果
     */
    @Override
    public int deleteQiushiFormItemById(Long id) {
        return qiushiFormItemMapper.deleteQiushiFormItemById(id);
    }
}
